From: Florian Müllner Date: Mon, 17 May 2010 12:03:47 +0000 (+0200) Subject: [clockPreferences] Fix translations X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~10028 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=764f5b62f01d7cb6372dac5a1aae95690ff8074d;p=gnome-shell.git [clockPreferences] Fix translations The preference dialog for the panel clock does not set its gettext domain, so it's not translated even if though translations are already available. Fix by setting the domain in the GtkBuilder file and binding the domain to the locale directory. https://bugzilla.gnome.org/show_bug.cgi?id=618873 --- diff --git a/data/clock-preferences.ui b/data/clock-preferences.ui index cc04f725e..2e22d9aa9 100644 --- a/data/clock-preferences.ui +++ b/data/clock-preferences.ui @@ -1,5 +1,5 @@ - + diff --git a/js/prefs/clockPreferences.js b/js/prefs/clockPreferences.js index 757eb7cf1..180358bad 100644 --- a/js/prefs/clockPreferences.js +++ b/js/prefs/clockPreferences.js @@ -7,6 +7,8 @@ const GConf = imports.gi.GConf; const Lang = imports.lang; const Signals = imports.signals; +const Gettext = imports.gettext; + const GCONF_DIR = '/desktop/gnome/shell/clock'; const FORMAT_KEY = GCONF_DIR + '/format'; const SHOW_DATE_KEY = GCONF_DIR + '/show_date'; @@ -80,6 +82,9 @@ Signals.addSignalMethods(ClockPreferences.prototype); function main(params) { if ('progName' in params) GLib.set_prgname(params['progName']); + if ('localeDir' in params) + Gettext.bindtextdomain('gnome-shell', params['localeDir']); + Gtk.init(null, null); let clockPrefs = new ClockPreferences(params['uiFile']); diff --git a/src/Makefile.am b/src/Makefile.am index 6200dc559..5ab98c351 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -26,6 +26,7 @@ EXTRA_DIST += gnome-shell.in gnome-shell-clock-preferences: gnome-shell-clock-preferences.in $(AM_V_GEN) sed -e "s|@pkgdatadir[@]|$(pkgdatadir)|" \ + -e "s|@localedir[@]|$(datadir)/locale|" \ -e "s|@GJS_CONSOLE[@]|$(GJS_CONSOLE)|" \ $< > $@ && chmod a+x $@ CLEANFILES += gnome-shell-clock-preferences diff --git a/src/gnome-shell-clock-preferences.in b/src/gnome-shell-clock-preferences.in index 419d0085d..9c471ab91 100644 --- a/src/gnome-shell-clock-preferences.in +++ b/src/gnome-shell-clock-preferences.in @@ -11,8 +11,11 @@ else fi progName="`basename $0`" +localeDir="@localedir@" uiFile="$uiDir/clock-preferences.ui" export GJS_PATH="$jsDir" @GJS_CONSOLE@ -c "const ClockPreferences = imports.prefs.clockPreferences; -ClockPreferences.main({ progName: '$progName', uiFile: '$uiFile' });" +ClockPreferences.main({ progName: '$progName', + uiFile: '$uiFile', + localeDir: '$localeDir' });"